package com.zb.zeus.system.api;

import com.zb.zeus.common.core.domain.R;
import com.zb.zeus.system.api.factory.RemoteAuthFallbackFactory;
import com.zb.zeus.system.api.model.LoginForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * 授权服务
 *
 * @author zb.zeus
 */
@FeignClient(contextId = "remoteAuthService",
        value = "${feign.ref.service.zeus-auth:zeus-auth}",
        fallbackFactory = RemoteAuthFallbackFactory.class)
public interface RemoteAuthService {
    /**
     * 通过用户名查询用户信息
     *
     * @param loginForm 登入参数表
     * @return 结果
     */
    @PostMapping(value = "/login")
    R<Map<String, Object>> login(@RequestBody LoginForm loginForm);


    /**
     * 登出
     * @return
     */
    @DeleteMapping("/logout")
    R<?> logout();

    @PostMapping("refresh")
    R<?> refresh();

}
